//
//  startPageViewController.m
//  Instant2
//
//  Created by dllo on 15/11/17.
//  Copyright © 2015年 蓝鸥科技. All rights reserved.
//

#import "startPageViewController.h"

@interface startPageViewController ()
@property (nonatomic, retain)UIImageView *imageV;
@property (nonatomic, assign)NSInteger mark;
@property (nonatomic, assign)NSInteger mark_1;
@end

@implementation startPageViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.imageV = [[UIImageView alloc] init];
    self.imageV.frame = self.view.frame;
    self.imageV.image = [UIImage imageNamed:@"pk.jpg"];
    self.imageV.center = self.view.center;
    [self.view addSubview:self.imageV];
    
    
//    UIImageView *ima  = [[UIImageView alloc] initWithFrame:CGRectMake(self.view.frame.size.width / 2-100 * WIDTH, self.view.frame.size.height / 3 - 100 * WIDTH, 200 * WIDTH, 200 * WIDTH)];
//    ima.backgroundColor = [UIColor clearColor];
//    //ima.center = self.view.center;
//    ima.image = [UIImage imageNamed:@"图标 2.png"];
//    ima.backgroundColor = [UIColor clearColor];
//    [self.view addSubview:ima];
    
    self.mark = 0;
    self.mark_1 =0;
    [NSTimer scheduledTimerWithTimeInterval:0.01 target:self selector:@selector(buttonAction) userInfo:nil repeats:YES];
    

}



- (void)buttonAction
{
    
    self.imageV.frame = CGRectMake(0, 0, self.view.frame.size.width + 0.3 * self.mark, self.view.frame.size.height + (self.view.frame.size.height / self.view.frame.size.width)*(0.3 * self.mark)  );
    self.imageV.center = self.view.center;
    //[self.startPageDelegate startPageAction];
    if (self.mark < 140) {
        self.mark++;
    }
    if (self.mark_1 == 180) {
        [self.startPageDelegate startPageAction];
    }
    
    self.mark_1++;
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
